home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
rbbs_pc
/
173bmrg.zip
/
RSB51028.MRG
< prev
next >
Wrap
Text File
|
1990-10-28
|
5KB
|
92 lines
* ------------[ BLED merge (c) Ken Goosens ]-------------
* Merge this against 17.3A\RBBSSUB5.BAS to produce 17.3B\RBBSSUB5.BAS
* 17.3A\RBBSSUB5.BAS: Date 9-25-1990 Size 92565 bytes
* ------------[ Created 10-28-1990 12:00:01 ]------------
* REPLACING old line(s) by new
' $linesize:132
* ------[ first line different ]------
' $title: 'RBBSSUB5.BAS 17.3B, Copyright 1986 - 90 by D. Thomas Mack' ' DA081003
' Copyright 1990 by D. Thomas Mack, all rights reserved.
' Name ...............: RBBSSUB5.BAS
' First Released .....: February 11, 1990
' Subsequent Releases.: August 26, 1990; October 28, 1990
' Copyright ..........: 1986 - 1990
' Purpose.............: The Remote Bulletin Board System for the IBM PC,
' RBBS-PC.BAS utilizes a lot of common subroutines. Those that do not
' require error trapping are incorporated within RBBSSUB 2-5 as
' separately callable subroutines in order to free up as much
' code as possible within the 64K code segment used by RBBS-PC.BAS.
' Parameters..........: Most parameters are passed via a COMMON statement.
'
' Subroutine Line Function of Subroutine
' Name Number
' BinSearch 63520 Binary searches sorted file for a key value
' BreakFileName 63300 Break file name into component parts
' BufAsUnit 63500 Buffer out a string with CR's
' SetPrompt 63470 Set prompts based on the user's security
' DoorReturn 63100 Process door requests
' FdMacExe 63462 Executes a found macro
' FileSystem 20117 File System for RBBS-PC
' FindIt 63490 Check whether file exists and if so open as #2
' FormRead 63420 Read from file into a form
' LockAppend 63400 Prepare for a file append
' MacroExe 63460 Execute internal macro rather than user
' MsgNameMatch 63540 Match name to one in msg header
' NoPath 63480 Detects whether string has a path in it
' RestoreCom 63310 Restore comm port after external program
' ReadMacro 63330 Read and process macro
' ShellExit 63320 Exit RBBS via shell
' TakeOffHook 63530 Take modem off hook
' UnLockAppend 63410 Clean up after file append
' VerifyAns 63510 Verify that string passes edits
' WildCard 63200 Match string to a pattern
'
' $INCLUDE: 'RBBS-VAR.BAS'
'
* REPLACING old line(s) by new
20163 ZFileName$ = ZFileNameHold$
* ------[ first line different ]------
CALL BadName (BadFileNameIndex,ZTrue) ' KG101201
ON BadFileNameIndex GOTO 20164,20176
* REPLACING old line(s) by new
* ------[ first line different ]------
20235 CALL BadName (BadFileNameIndex,ZTrue) ' KG101201
ON BadFileNameIndex GOTO 20236,20245
* REPLACING old line(s) by new
63520 ' $SUBTITLE: 'BinSearch - binary search a file'
' $PAGE
'
' NAME -- BinSearch
' MEANING
' INPUTS -- PassedSearchFor$ Value you are looking for
' StartPos Starting position of sort key
' NumChars # of characters in sort key
' LenRec Length of record of data file searching
' High Record # of last record
' ZFastTabs$ In a binary integer subfield (2 bytes)
' holds 1st record when might find
' a key beginning with a particular
' character (0-9,A-Z). Empty if
' no Fast Tab exists for the file.
'
' OUTPUTS -- RecFoundAt Record # value found at (0 if none)
' RecFound$ Full data record when found
'
' PURPOSE -- Binary searches work file #2 for a key value in a
' data file that is sorted on a key field
'
SUB BinSearch (PassedSearchFor$,StartPos, NumChars, LenRec, High, RecFoundAt, RecFound$) STATIC
SearchFor$ = LEFT$(PassedSearchFor$,NumChars)
SearchFor$ = SearchFor$ + SPACE$(NumChars-LEN(SearchFor$))
FIELD #2, LenRec AS SearchRec$
Low = 0
IF LEN(ZFastTabs$) < 72 THEN _
GOTO 63522
WasX$ = LEFT$(SearchFor$,1)
WasX = INSTR("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",WasX$)
IF WasX > 0 THEN _
* ------[ first line different ]------
Low = CVI(MID$(ZFastTabs$,1+2*(WasX-1),2)) - 1 : _ ' KG102701
IF WasX < 36 THEN _ ' KG102701
High = CVI(MID$(ZFastTabs$,1+2*WasX,2)) ' KG102701